<!-- 同步心电数据 -->
<template>
	<el-dialog title="同步心电数据" :visible.sync="detailVisible" width="600" :before-close="handleClose">
		<avue-form :option="option" v-model="form" @submit="submit"></avue-form>
		<span slot="footer" class="avue-dialog__footer">
			<el-button type="primary" size="small" @click="save" icon="el-icon-circle-plus-outline">同 步</el-button>
			<el-button size="small" @click="detailVisible = false" icon="el-icon-circle-close">关 闭</el-button>
		</span>
	</el-dialog>
</template>

<script>
export default {
	data() {
		return {
			detailVisible: false,
			form: {}
		};
	},
	computed: {
		option() {
			return {
				submitBtn: false,
				emptyBtn: false,
				span: 20,
				column: [
					{
						label: '病人',
						prop: 'driverPermitCity',
						type: 'select'
					},
					{
						label: '同步时间',
						prop: 'bussId',
						type: 'date',
						valueFormat: 'YYYY-MM-DD'
					}
				]
			};
		}
	},
	methods: {
		handleOpen() {
			this.detailVisible = true;
		},
		handleClose() {
			this.detailVisible = false;
		},
		submit(form, done) {
			let { enterpriseId, $enterpriseId, bussId, driverPermitCity, id, pic1, pic2 } = this.form;
			let params = {
				enterprise_id: enterpriseId,
				description: $enterpriseId,
				bussId,
				city: driverPermitCity,
				id,
				pic1,
				pic2
			};
			pass(params).then(res => {
				if (res.success) {
					this.$modal.msgSuccess('操作成功');
					this.$emit('setPassDialog', false);
				}
			});
			done();
		},
		save() {}
	}
};
</script>

<style>
.el-dialog__header {
	padding: 16px 24px;
	min-height: 20px;
	border-bottom: 1px solid #f0f0f0;
}
</style>
